import request from '@/utils/request'
import { downFile } from '@/utils/request'

/**
 * 退款政策分页查询
 * @param {查询条件} data
 */
export function listLayRefundPolicy(query) {
  return request({
    url: 'business/LayRefundPolicy/list',
    method: 'get',
    params: query,
  })
}

/**
 * 新增退款政策
 * @param data
 */
export function addLayRefundPolicy(data) {
  return request({
    url: 'business/LayRefundPolicy',
    method: 'post',
    data: data,
  })
}
/**
 * 修改退款政策
 * @param data
 */
export function updateLayRefundPolicy(data) {
  return request({
    url: 'business/LayRefundPolicy',
    method: 'PUT',
    data: data,
  })
}
/**
 * 获取退款政策详情
 * @param {Id}
 */
export function getLayRefundPolicy(id) {
  return request({
    url: 'business/LayRefundPolicy/' + id,
    method: 'get'
  })
}

/**
 * 删除退款政策
 * @param {主键} pid
 */
export function delLayRefundPolicy(pid) {
  return request({
    url: 'business/LayRefundPolicy/delete/' + pid,
    method: 'POST'
  })
}
// 导出退款政策
export async function exportLayRefundPolicy(query) {
  await downFile('business/LayRefundPolicy/export', { ...query })
}
